package tester;

/**
 * Created by IntelliJ IDEA.
 * User: aleck
 * Date: 2007-10-23
 * Time: 9:41:17
 * To change this template use File | Settings | File Templates.
 */
public class ProblemsTesterThread extends BaseTesterThread {
  private final ProblemManager problems;
  private final int[] cols;
  private final PersonManager persons;

  public ProblemsTesterThread(ProblemManager problems, int[] cols,
                              PersonManager persons) {
    this.problems = problems;
    this.cols = cols;
    this.persons = persons;
  }

  public void run() {
    for (int i : cols) {
      if (i == 0) continue;
      Problem problem = problems.problemList.get(i - 1);
      for (Person person : persons.personList) {
        PersonProblemTester spt =
            new PersonProblemTester(person, problem, Config.getWorkDir());
        spt.runTest();
      }
    }
    MessageOutput.println(finishedMessage);
  }
}
